package com.lagou.sqlsession;

import com.lagou.pojo.Configuration;
import com.lagou.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

/**
 * @description: sql执行器
 * @author oyz
 * @date 2022/10/16 9:38
 * @version 1.0
 */
public interface Executor {


    <E> List<E> query(Configuration configuration, MappedStatement mappedStatement,Object... params) throws SQLException, Exception;

    /**
     * 定义一个插入方法
     */
    int insert(Configuration configuration, MappedStatement mappedStatement,Object... params) throws Exception;

    int update(Configuration configuration, MappedStatement mappedStatement, Object[] params) throws Exception;

    /**
     * 定义删除方法
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    int deleteUser(Configuration configuration, MappedStatement mappedStatement, Object[] params) throws Exception;
}
